<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
    	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    	<meta name="viewport" content="width=device-width, initial-scale=1">
    	<link rel="stylesheet" href="dist/css/bootstrap.min.css" type="text/css"/>
    	<link rel="stylesheet" type="text/css" href="dist/css/app.css"/>
    	<script src="dist/js/jq0908.min.js" type="text/javascript" charset="utf-8"></script>
    	<script src="dist/js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
    	<script src="dist/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
    	<script src="dist/js/style.js" type="text/javascript" charset="utf-8"></script>
    	<script src="dist/js/public.js" type="text/javascript" charset="utf-8"></script>
		<title>QUANTUM MATERIALS</title>
	</head>
	<body>
		<div class="container-fluid" style="padding: 0;">
			<!--顶部导航-->
			<div class="top-container">
				<div class="top-head">
					<div class="left-info center_V">
						<img src="images/map.png" alt="map icon" class="center_V"/>
						<div class="info-text">
							2018 Symposium on Quantum Materials <br />
							Synthesis: Grand Challenges and Opportunities<br />
							November 15-17, 2018<br />
							Shanghai International Convention Center, Oriental Riverside Hotel, Shanghai
						</div>
					</div>
					<div class="center-logo center_" >
						<img src="images/logo.png" alt="LOGO" class="img-responsive"/>
					</div>
					<div class="right-sharepart center_V">
						<div id="share-title">
							<img src="images/share.png" alt="share icon" />
							Share with someone
						</div>
					</div>
					<div class="right-icon center_V">
						<a href="login.html" id="go_login" data-login="0"><img src="images/login.png" alt="login icon"/></a>
						<a href="javascript:void(0)" id="sign_out" class="btn btn-default">Sign out</a>
					</div>
					
				</div>
				<div class="nav-container clearfix">
					<ul class="list-inline pull-left">
						<li>
							<a href="javascript:void(0)" class="nav-item">INFO</a>
							<ul class="list-unstyled second-nav" >
								<li>
									<a href="importantdate.html">
										IMPORTANT DATES
									</a>
								</li>
								<li>
									<a href="spceilEvent.html">
										SPECIAL EVENTS
									</a>
								</li>
								<li>
									<a href="digest.html">
										DIGEST BOOK
									</a>
								</li>
								<li>
									<a href="qms.html">
										ABOUT QMS
									</a>
								</li>
							</ul>
						</li>
						<li>
							<a href="register.html" class="nav-item">REGISTER</a>
							<ul class="list-unstyled second-nav" style="min-width: 120%;">
								<li>
									<a href="register.html">
										ACCOUNT
									</a>
								</li>
								<li>
									<a href="javascript:void(0)" id="goposter1">
										 POSTER
									</a>
								</li>
								<li>
									<a href="javascript:void(0)" id="goabstract1">
										ABSTRACT
									</a>
								</li>
								<li>
									<a href="hotel.html">
										HOTEL
									</a>
								</li>
							</ul>
						</li>
						<li>
							<a href="invitedSpeaker.html" class="nav-item">INVITED SPEAKERS</a>
						</li>
						<li>
							<a href="program.html" class="nav-item">PROGRAM</a>
						</li>
						<li>
							<a href="organization.html" class="nav-item">ORGANIZATION</a>
						</li>
						<li>
							<a href="sponsors.html" class="nav-item">SPONSORS</a>
						</li>
						<li>
							<a href="contract.html" class="nav-item">CONTACT</a>
						</li>
					</ul>
				</div>
			</div>
			<div class="form-submit-part mid-part" style="padding-top: 0;overflow: hidden;">
				<img src="images/pic_a.jpg" alt="top img" class="img-responsive"/>
				<div class="poster-container " style="width: 62.5%;z-index: 88;position: relative;margin: 18% auto 60px;">
					<div class="form-part poster" style="top:0;width: 100%;z-index: 88;">
						<form id="formdata" enctype="multipart/form-data">
							<div class="row">
								<div class="col-md-6">
									<label>Email</label>
									<div class="email_text text_style"></div>
								</div>
								<div class="col-md-6">
									<label>Name</label>
									<div class="name_text text_style"></div>
								</div>
							</div>
							<div class="row">
								<div class="col-md-6">
									<label>Unit</label>
									<div class="unit_text text_style"></div>
								</div>
								<div class="col-md-6">
									<label>Identity</label>
									<div class="identity_text text_style"></div>
								</div>
							</div>
							<div class="filebox">
								<label for="file" id="file_btn">UPLOAD POSTER</label>
								<input type="file" name="file" id="file" style="display: none;" />
							</div>
						</form>
					</div>
					<div class="poster_load_file_con">
						<div class="file_state0">
							<img src="images/no.png" alt="state icon" style="width:100% ;"/>
							<p class="state-text">NO POSTER</p>
						</div>
						
					</div>
				</div>
			</div>
			<!--footer-->
			<div class="footer">
				<div class="top-logo">
					<img src="images/logo.png" class="center_" alt="logo"/>
				</div>
				<div class="footer-text">
					sponsored by Fudan Unviversity   Contact Us | by XXX
				</div>
			</div>
		</div>
		<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" id="tips">
		  <div class="modal-dialog modal-sm" role="document">
			<div class="modal-content">
		      <div class="modal-header">
		      	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
		      	<h4 class="modal-title" id="mySmallModalLabel">Hints</h4>
		      </div>
		      <div class="modal-body">
					Poster upload fail,please upload again!
		      </div>
		    </div>
		  </div>
		</div>
		<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" id="tips2">
		  <div class="modal-dialog modal-sm" role="document">
			<div class="modal-content">
		      <div class="modal-header">
		      	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
		      	<h4 class="modal-title" id="mySmallModalLabel">Hints</h4>
		      </div>
		      <div class="modal-body">
					Poster upload fail,please upload again!
		      </div>
		    </div>
		  </div>
		</div>
	</body>
</html>
<script type="text/javascript">
	$(function(){
		var useEmail = $.cookie('useEmail');
		var usename = $.cookie('usename');
		var useunit = $.cookie('useunit');
		var useidentity = $.cookie('useidentity');
		var user_id = $.cookie('userid');
		$('#tips2').on('hidden.bs.modal', function (e) {
		 window.location.href='login.html'
		})
		if(user_id==undefined || user_id==''){
			$('#tips2').modal('show');
			return false
		}
		
		$.ajax({
			type:"post",
			url:"http://10.107.12.43:8080/interwar/poster/getposterList.do?user_id="+user_id,
			async:true,
			dataType:"json",
			success:function(data){
				var filedata = data.date;
				console.log(filedata)
				if(filedata==null){
					$('.file_state0').css('display','block')
				}else{
					var html1 = '<div class="file_state" >'+
						'<img src="images/shenhz.png" alt="state icon"/>'+
						'<p class="file_name">'+filedata.Accessory_name+'</p>'+
						'<p class="state-text">Waiting for audit</p>'+
						'</div>'
					var html2 = '<div class="file_state" >'+
								'<img src="images/chengg.png" alt="state icon"/>'+
								'<p class="file_name">'+filedata.Accessory_name+'</p>'+
								'<p class="state-text">Audit success</p>'+
							'</div>'
					var html3 = '<div class="reject">'+
									'<div class="file_state3">'+
										'<img src="images/shenhsb.png" alt="state icon"/>'+
										'<p class="file_name">'+filedata.Accessory_name+'</p>'+
										'<p class="state-text">Audit refuse</p>'+
									'</div>'+
									'<label for="file" id="re_upload">Re Upload</label>'+
									'<div class="reject_text">'+filedata.Accessory_con+'</div>'+
								'</div>'
							//console.log(filedata.Accessory_zt)
					if(filedata.Accessory_zt==1){
						$('.poster_load_file_con').html(html1)
					}else if(filedata.Accessory_zt==3){
						$('.poster_load_file_con').html(html2)
					}else{
						$('.poster_load_file_con').html(html3)
					}
					//$('.file_state').css('display','block');
				}
			}
		});
		$('.identity_text').text(useidentity);
		$('.email_text').text(useEmail)
		$('.name_text').text(usename)
		$('.unit_text').text(useunit)
		$('#file').on('change', function() {
			 var fd = new FormData($('#formdata'));
			 fd.append("user_id",user_id);
			 fd.append("upload1", $("#file").get(0).files[0]);
			 if($("#file").get(0).files.length!=0){
			 	var filename = $("#file").get(0).files[0].name
			 	$.ajax({
				 url: "http://10.107.12.43:8080/interwar/poster/uploadp.do?user_id="+user_id,
				 type: "POST",
				 processData: false,
				 contentType: false,
				 data: fd,
				 success: function(d) {
				 if(d.code==0){
				 	var html1 = '<div class="file_state" >'+
						'<img src="images/icon_a.png" alt="state icon"/>'+
						'<p class="file_name">'+filename+'</p>'+
						'<p class="state-text">Waiting for audit</p>'+
						'</div>'
					$('.poster_load_file_con').html(html1)
				 }else{
				 	$('#tips').modal('show')
				 }
				}
			 });
		}
		});
			 
			 
	})
</script>
